# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=libfm-qt
pkgver=1.1.0
pkgrel=0
pkgdesc="Qt port of libfm"
url="https://github.com/lxqt/libfm-qt"
arch="all !s390x" # s390x blocked by libfm
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools qt5-qtx11extras-dev qt5-qttools-dev
	menu-cache-dev libexif-dev libfm-dev qt5-qtbase-dev
	"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/libfm-qt/releases/download/$pkgver/libfm-qt-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
6717bc3fd3a2795389071e4dbfba2e73f3abfeafce8a583f99b3281e60347430db48246eb29796c5b7647b35b064824e90fc3a286547288798a1c6da3a3f5137  libfm-qt-1.1.0.tar.xz
"
